package com.hitales.ma.medicalrecord.api;

import com.hitales.ma.medicalrecord.pojo.CustomResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RestController;

import java.util.Locale;

@RestController
public class TestController {

    @Autowired
    private MessageSource messageSource;

    @GetMapping("/greet")
    public CustomResponse getGreeting(@RequestHeader(name = "Accept-Language", required = false) Locale locale) {
        return new CustomResponse("aaaaa",200);
//        return messageSource.getMessage("greeting", null, locale);
    }
}
